from .controller.osController import scan_tools
import json
from django.http.response import JsonResponse
from django.views import View


class scan_ip(View):
    @staticmethod
    def post(request):
        body = json.loads(request.body)
        scan_tools(body["ip"], body["port"])
        response = {'code': 200, 'msg': "执行成功", 'errmsg': "执行失败"}
        return JsonResponse(response)
